REM ##### DESIRED_OFFSET_H should be relative to webkit directory
set WEBKIT_DIR=%1
set DESIRED_OFFSET_H=%2

set RUBY=..\tools\ruby-1.9.3\bin\ruby.exe
set OFFLINEASM_DIR=Source\JavaScriptCore\offlineasm
set LLINT_DIR=Source\JavaScriptCore\llint

cd "%WEBKIT_DIR%"

REM ensure the subdirs for DESIRED_OFFSET_H exist
set DESIRED_OFFSET_DIR=%~dp2
mkdir "%DESIRED_OFFSET_DIR%" 2> NUL

"%RUBY%" "%OFFLINEASM_DIR%\generate_offset_extractor.rb" "%LLINT_DIR%\LowLevelInterpreter.asm" %DESIRED_OFFSET_H%
